/**
 * Beijing Jiaotong University
 * Copyright (c) 1896-2016 All Rights Reserved.
 */
package org.myws.service.impl;

import javax.annotation.Resource;

import org.myws.dao.mybatis.dao.DepartmentMapper;
import org.myws.dao.mybatis.domain.Department;
import org.myws.service.DepartmentService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSON;

/**
 * 
 * @author HuHui
 * @version $Id: DepartmentServiceImpl.java, v 0.1 2016年5月8日 下午3:47:01 HuHui Exp $
 */
@Service
public class DepartmentServiceImpl implements DepartmentService {

    private Logger           log = LoggerFactory.getLogger(DepartmentServiceImpl.class);

    @Resource
    private DepartmentMapper departmentMapper;

    @Override
    public Department getById(Long id) {
        log.info("收到查询Department请求,参数id={}", id);
        Department dept = departmentMapper.selectByPrimaryKey(id);
        log.info("Department查询结果:{}", JSON.toJSONString(dept));
        return dept;
    }

}
